<template>
  <a-modal
    title="账号登录盘创建记录"
    :width="800"
    :visible="visible" 
    @ok="handleSubmit"
    @cancel="handleCancel"
    cancelText="关闭"
    style="top:20px;"
  >
   
  <!-- table区域-begin -->
    <div>
       <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap" 
        @change="handleTableChange">

       
      <span slot="msgAction" slot-scope="text, record"> 
          
         <span v-if="text=='输入短信验证码'">
           <a-input class="yzminput" placeholder="请输入短信验证码" v-model="model.maoPassword" />
           <a @click="handleCreateLoginSend()">发送</a>
        </span>
        <span v-if="text!='输入短信验证码'">
          {{text}}
        </span>
        
      </span> 
      </a-table>
    </div>
    <!-- table区域-end -->
  </a-modal>
</template>

<script>
  import {changePassword} from '@/api/api'
  import '@/assets/less/TableExpand.less'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'

  import {   postAction  } from '@/api/manage'

  export default {
    name: "LogModal",
    mixins:[JeecgListMixin],
    data () {
      return {
        visible: false,  
        queryParam: {},
        model: {}, 
        record:{},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        columns: [  
          {
                title: '时间',
                align:"center",
                dataIndex: 'createTime'
              } ,
        
          {
                title: '日志内容',
                align:"center",
                dataIndex: 'logMsg',
                scopedSlots: { customRender: 'msgAction' }, 
              }
            ],
        url: {
              list: "/phone/phoneAccountLog/list",  
              handleCreateLoginSend: "/phone/phoneAccount/handleCreateLoginSend", 
         
          },
      }
    },
    created () {
      console.log("created");
        // setInterval(() => {
        //     console.log("检查进度中。。。");
        //      this.loadData(1);
        //   }, 3000);
    },

    methods: {
      show (record) {
         
        this.visible = true;
        this.record = record; 
        this.$nextTick(() => { 
        console.log("next");
        });
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.disableSubmit = false;
        this.selectedRole = [];
      },
      handleSubmit () { 
       this.close()
      },
      handleCancel () {
        this.close()
      },
 
      handleCreateLoginSend () {
         this.record.maoPassword = this.model.maoPassword;
         postAction(`${window._CONFIG['domianURL']}/${this.url.handleCreateLoginSend}`, this.record).then((res) => {
          if (res.success) { 
             this.$message.success(res.message)
          } else {
            this.$message.warning(res.message)
          }
        }) 
      },
  
  
      
    }
  }
</script>

<style scoped>
  @import '~@assets/less/common.less';

  .yzminput{
    width: 200px;
  }
</style>